package cn.tedu.cat.mapper;

import cn.tedu.cat.entity.Baobei;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BaobeiMapper {
    @Insert("insert into baobei values(null,#{title},#{content}" +
            ",#{url},#{sort})")
    void insert(Baobei baoBei);

    @Select("select id,title,url,content from baobei where sort=1")
    List<Baobei> select();
    @Select("select id,title,url,content from baobei where sort=2")
    List<Baobei> select2();
    @Select("select id,title,url,content from baobei where sort=3")
    List<Baobei> select3();
    @Select("select id,title,url,content from baobei where sort=4")
    List<Baobei> select4();
    @Select("select id,title,url,content from baobei where sort=5")
    List<Baobei> select5();
    @Select("select id,title,url,content from baobei where sort=6")
    List<Baobei> select6();

    @Select("select id,title,content,url from baobei where id=#{id}")
    Baobei selectById(int id);
}
